package com.example.demo.Mapper;

import com.example.demo.Entity.Docker;
import com.example.demo.Entity.tansfer.UserDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

//
@Repository
@Mapper
public interface DockerMapper {

    //根据手机号查医生信息
    @Select("select * from docker where phone=#{phone}")
    Docker getDockerInfoByPhone(@Param("phone") String phone);


    //获取全部医生信息
    @Select("select * from docker ")
    Docker getDockerInfo();


    //获取医生登陆信息
    @Select("select * from docker where phone=#{phone} and  password=#{password}")
    Docker getDockerInfoforLogin(@Param("phone") String phone,@Param("password") String password);


    //新增医生
    @Insert("INSERT INTO docker (phone,PASSWORD,realName,sex,create_time,position,department) VALUES(#{phone},#{passWord}," +
            "#{realName},#{sex},NOW(),#{position},#{department})")
    int addDocker(UserDTO userDTO);

}
